package com.example.zhunongzonghe.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.zhunongzonghe.beans.ZnExchangeCommentBean;
import com.example.zhunongzonghe.entity.ZnExchangeComment;


public interface IZnExchangeCommentService extends IService<ZnExchangeComment> {

    Page<ZnExchangeCommentBean> CommentAll(Integer currentPage,Integer pageNum,Object SearchInfo);

    /**
     * 查询评论及子评论
     * @param postId
     * @param currentPage
     * @param pageSize
     * @return
     */
    Page<ZnExchangeCommentBean> CommentList(Integer postId, Integer currentPage,Integer pageSize);

    /**
     * 用户发布根评论
     * @param commentBean
     * @param userName
     * @return
     */
    ZnExchangeComment AddRootComment(ZnExchangeCommentBean commentBean,String userName);

    /**
     * 用户发布子评论
     * @param commentBean
     * @param userName
     * @return
     */
    ZnExchangeComment AddSonComment(ZnExchangeCommentBean commentBean,String userName);

    /**
     * 查询当前帖子评论总数
     * @param postId
     * @return
     */
    Long CommentNumBer(Integer postId);
}
